import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-10-09
 * Time: 11:30
 */
public class Test2 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.print("请输入一个英文字符串:");

        String str = sc.nextLine();

        // System.out.println("原字符串是 :"+str);

        StringBuilder ss = new StringBuilder(str);



        for (int i = 0; i < ss.length(); i++) {

            char c = ss.charAt(i);

            if (c > 'U' && c <= 'Z') {

                c = (char) (c - 21);

            } else if (c > 'u' && c <= 'z') {

                c = (char) (c - 21);

            } else {

                c = (char) (c + 5);

            }

            ss.setCharAt(i, c);

        }

        System.out.println("加密后的字符串是:" + ss);

    }

}
